package com.jack.thead;

import com.sun.org.apache.xml.internal.security.keys.storage.implementations.CertsInFilesystemDirectoryResolver;

public class TheadTest extends Thread {

    public static void main(String[] args){
        System.out.println("processor:" + Runtime.getRuntime().availableProcessors());
        printThreadInfo();

        Thread newThread = new TheadTest();
        newThread.start();

        try{
            newThread.join();
        }
        catch (InterruptedException ex)
        {
            ex.printStackTrace();
        }

    }

    @Override
    public void run() {
        printThreadInfo();
    }

    private static void printThreadInfo(){
        Thread current = Thread.currentThread();
        System.out.println("name:" + current.getName());
        System.out.println("state:" + current.getState());
        System.out.println("daemon:" + current.isDaemon());
        System.out.println("priority: " + current.getPriority());
        System.out.println("id:" + current.getId());
    }
}
